package com.shahe.GirlsDay.util;

import org.json.JSONException;
import org.json.JSONObject;

public class PeriodInfo {
	private int periodid = 0;
	private String firstday = " ";
	private String lastday = " ";
	private String periodlength = " ";
	private int userid = 0;

	public PeriodInfo() {
	}

	public PeriodInfo(JSONObject json) throws JSONException {
		this.periodid = json.getInt("periodid");
		this.firstday = json.getString("firstaday");
		this.lastday = json.getString("lastday");
		this.periodlength = json.getString("periodlength");
		this.userid = json.getInt("userid");
	}
	
	public int getPeridid() {
        return periodid;
    }

    public void setPeridid(int periodid) {
        this.periodid = periodid;
    }

    public String getFirstday() {
        return firstday;
    }

    public void setFirstday(String firstday) {
        this.firstday = firstday;
    }

    public String getLastday() {
        return lastday;
    }

    public void setLastday(String lastday) {
        this.lastday = lastday;
    }

    public String getPeriodLength() {
        return periodlength;
    }

    public void setPeriodLength(String periodlength) {
        this.periodlength = periodlength;
    }

    public int getUserid() {
        return userid;
    }

    public void setUserid(int userid) {
        this.userid = userid;
    }

    public JSONObject toJson() throws JSONException {
		JSONObject json = new JSONObject();
		json.put("periodid", periodid);
		json.put("firstaday",firstday);
		json.put("lastday",lastday);
		json.put("periodlength", periodlength);
		json.put("userid", userid);
		return json;
    }

}
